package org.foundation.jala.jamerzip.components;

import java.lang.IllegalArgumentException;
import java.lang.Iterable;
import java.util.*;

public class JamerDirectory extends JamerFileElement implements Iterable<JamerFileElement>{

    private List<JamerFileElement> elements;

    public JamerDirectory() {
        elements = new ArrayList<JamerFileElement>();
    }

    
    
    public void addElement(JamerFileElement element) throws IllegalArgumentException {
        if(element == null) 
            throw new IllegalArgumentException("element must not be null");
        elements.add(element);
    }

    public void removeElement(JamerFileElement element) {
        elements.remove(element);
    }

    public int size() {
        return elements.size();
    }

    public Iterator<JamerFileElement> iterator() {
         return elements.iterator();
    }

}

